<%
select case Ssort
	case "NameFirm": 
		if Ssort="NameFirm" and SN="y" then
			strOrder="NameFirm desc"
			SN="n"
		else
			strOrder="NameFirm"
			SN="y"
		end if
	case "RodDejat": 
		if Ssort="RodDejat" and SN="y" then
			strOrder="RodDejat desc"
			SN="n"
		else
			strOrder="RodDejat"
			SN="y"
		end if
	case "Address": 
		if Ssort="Address" and SN="y" then
			strOrder="Address desc"
			SN="n"
		else
			strOrder="Address"
			SN="y"
		end if
	case "Site": 
		if Ssort="Site" and SN="y" then
			strOrder="Site desc"
			SN="n"
		else
			strOrder="Site"
			SN="y"
		end if
	case "Potrebnosti": 
		if Ssort="Potrebnosti" and SN="y" then
			strOrder="Potrebnosti desc"
			SN="n"
		else
			strOrder="Potrebnosti"
			SN="y"
		end if
	case "CntShop": 
		if Ssort="CntShop" and SN="y" then
			strOrder="CntShop desc"
			SN="n"
		else
			strOrder="CntShop"
			SN="y"
		end if
	case "CntPlace": 
		if Ssort="CntPlace" and SN="y" then
			strOrder="CntPlace desc"
			SN="n"
		else
			strOrder="CntPlace"
			SN="y"
		end if
	case "ArendaSum": 
		if Ssort="ArendaSum" and SN="y" then
			strOrder="ArendaSum desc"
			SN="n"
		else
			strOrder="ArendaSum"
			SN="y"
		end if
	case "ArendaDatePay": 
		if Ssort="ArendaDatePay" and SN="y" then
			strOrder="ArendaDatePay desc"
			SN="n"
		else
			strOrder="ArendaDatePay"
			SN="y"
		end if
	case "DogovorDate": 
		if Ssort="DogovorDate" and SN="y" then
			strOrder="DogovorDate desc"
			SN="n"
		else
			strOrder="DogovorDate"
			SN="y"
		end if
	case "DogovorDateEND": 
		if Ssort="DogovorDateEND" and SN="y" then
			strOrder="DogovorDateEND desc"
			SN="n"
		else
			strOrder="DogovorDateEND"
			SN="y"
		end if
	case else: strOrder="NameFirm"
end select
%>